
package com.plian.system.service.pm.annualdonationrecordmain;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.plian.system.dto.pm.annualdonationrecordmain.AnnualDonationRecordMainDTO;
import com.plian.system.entity.pm.annualdonationrecordmain.AnnualDonationRecordMain;
import com.plian.system.model.R;
import com.plian.system.mybatis.base.BaseService;
import com.plian.system.vo.pm.annualdonationrecordmain.AnnualDonationRecordMainVO;
import com.plian.system.vo.pm.annualdonationrecordmain.AnnualDonationRecordStatisticalDetailVO;
import com.plian.system.vo.pm.annualdonationrecordmain.AnnualDonationRecordStatisticalVO;
import com.plian.system.vo.report.ReportReturnVO;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.Date;
import java.util.List;

/**
 * 企业年度捐赠计划备案 服务类
 */
public interface IAnnualDonationRecordMainService extends BaseService<AnnualDonationRecordMain> {

    /**
     * 校验编码唯一性
     *
     * @param id
     * @param code
     * @return
     */
    Boolean checkIsExisted(Long id, String code);

    /**
     * 校验年度唯一
     *
     * @param id              主键
     * @param reportCompanyId 单位主键
     * @param year            年度
     * @return 错误明细
     */
    String checkYear(Long id, Long reportCompanyId, Date year);

    /**
     * 保存主子表
     *
     * @param annualDonationRecordMain
     * @return
     */
    boolean submit(AnnualDonationRecordMain annualDonationRecordMain);

    /**
     * 将子表数据与主表关联
     *
     * @param annualDonationRecordMainVO
     * @return
     */
    AnnualDonationRecordMainVO setChild(AnnualDonationRecordMainVO annualDonationRecordMainVO);

    /**
     * 年度捐赠计划执行选备案参照list
     *
     * @param page         page
     * @param queryWrapper queryWrapper
     * @return IPage<AnnualDonationRecordMainVO>
     */
    IPage<AnnualDonationRecordMain> preList(IPage<AnnualDonationRecordMain> page, QueryWrapper queryWrapper);

    /**
     * 根据id打印
     *
     * @param id 主键
     * @return File
     */
    File buildpdf(Long id);

    /**
     * 根据id打印
     *
     * @param id 主键
     * @return File
     */
    File createReceptFile(Long id);

    /**
     * 校验唯一
     *
     * @param id         主键
     * @param code       编号
     * @param filingCode 备案编号
     * @return 错误明细
     */
    String checkIsExisted(Long id, String code, String filingCode);

    /**
     * 获取详情
     *
     * @param annualDonationRecordMainVO
     * @return
     */
    R<AnnualDonationRecordMainVO> getDetailObj(AnnualDonationRecordMainVO annualDonationRecordMainVO);

    /**
     * 获取详情,计划执行参照时显示没有被选过的参照
     *
     * @param annualDonationRecordMainVO
     * @return
     */
    R<AnnualDonationRecordMainVO> getPreDetailObj(AnnualDonationRecordMainVO annualDonationRecordMainVO);


    /**
     * 根据年度获取所有子表
     *
     * @param year
     * @return
     */
    R<AnnualDonationRecordMainVO> refByYear(String year);

    /**
     * 下载doc
     *
     * @param id
     * @return
     */
    File buildword(Long id, HttpServletResponse response);

    /**
     * 以备案号排序的年度捐赠计划备案统计报表
     *
     * @param annualDonationRecordMainDTO
     * @return
     */
    List<AnnualDonationRecordStatisticalVO> annualDonationRecordStatistical(AnnualDonationRecordMainDTO annualDonationRecordMainDTO);

    /**
     * 以备案号排序的年度捐赠计划备案统计明细
     *
     * @param annualDonationRecordMainDTO
     * @return
     */
    List<AnnualDonationRecordStatisticalDetailVO> annualDonationRecordStatisticalDetail(AnnualDonationRecordMainDTO annualDonationRecordMainDTO);

    /**
     * 以集团为单位的年度捐赠计划/执行统计报表
     *
     * @param annualDonationRecordMainDTO
     * @return
     */
    ReportReturnVO annualDonationYearStatistical(AnnualDonationRecordMainDTO annualDonationRecordMainDTO);

    /**
     * 以集团为单位的年度捐赠计划/执行统计 明细
     *
     * @param annualDonationRecordMainDTO
     * @return
     */
    ReportReturnVO annualDonationYearStatisticalDetail(AnnualDonationRecordMainDTO annualDonationRecordMainDTO);

    /**
     * 接受数字宁波data
     *
     * @param data
     * @return
     */
    String saveAnnualDonationRecordReform(String data);
    Boolean checkJzjh(Long id);
}
